@@ -107,6 +107,7 @@
struct sockaddr_in source;
char *device;
int pmtudisc = -1;
+extern int mark;
int
@@ -305,6 +306,12 @@
}
}
}
+ if (options & F_MARK) {
+ if (setsockopt(probe_fd, SOL_SOCKET, SO_MARK,
+ &mark, sizeof(mark)) == -1) {
+ fprintf(stderr, "Warning: Failed to set mark %d\n", mark);
+ }
+ }
if (settos &&
setsockopt(probe_fd, IPPROTO_IP, IP_TOS, (char *)&settos, sizeof(int)) < 0)
@@ -137,7 +137,7 @@
int pmtudisc=-1;
static int icmp_sock;
-
+extern int mark;
static struct in6_addr in6_anyaddr;
@@ -385,6 +385,12 @@
#endif
}
}
+ if (options & F_MARK) {
+ if (setsockopt(probe_fd, SOL_SOCKET, SO_MARK,
+ &mark, sizeof(mark)) == -1) {
+ fprintf(stderr, "Warning: Failed to set mark %d\n", mark);
+ }
+ }
firsthop.sin6_port = htons(1025);
if (connect(probe_fd, (struct sockaddr*)&firsthop, sizeof(firsthop)) == -1) {
perror("connect");