[BusyBox-cvs] busybox/networking/libiproute iproute.c,1.10,1.11
Glenn McGrath
bug1 at busybox.net
Sat Apr 26 02:22:22 UTC 2003
Update of /var/cvs/busybox/networking/libiproute
In directory winder:/tmp/cvs-serv1805/networking/libiproute
Modified Files:
iproute.c
Log Message:
iPatch from waldi, fixes usage of ip route flush (from)? (match|exact)
Index: iproute.c
===================================================================
RCS file: /var/cvs/busybox/networking/libiproute/iproute.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- iproute.c 19 Mar 2003 09:12:42 -0000 1.10
+++ iproute.c 26 Apr 2003 02:22:19 -0000 1.11
@@ -72,6 +72,8 @@
int len = n->nlmsg_len;
struct rtattr * tb[RTA_MAX+1];
char abuf[256];
+ inet_prefix dst;
+ inet_prefix src;
int host_len = -1;
SPRINT_BUF(b1);
@@ -143,6 +145,18 @@
memset(tb, 0, sizeof(tb));
parse_rtattr(tb, RTA_MAX, RTM_RTA(r), len);
+
+ if (filter.rdst.family && inet_addr_match(&dst, &filter.rdst, filter.rdst.bitlen))
+ return 0;
+ if (filter.mdst.family && filter.mdst.bitlen >= 0 &&
+ inet_addr_match(&dst, &filter.mdst, r->rtm_dst_len))
+ return 0;
+
+ if (filter.rsrc.family && inet_addr_match(&src, &filter.rsrc, filter.rsrc.bitlen))
+ return 0;
+ if (filter.msrc.family && filter.msrc.bitlen >= 0 &&
+ inet_addr_match(&src, &filter.msrc, r->rtm_src_len))
+ return 0;
if (filter.flushb &&
r->rtm_family == AF_INET6 &&
More information about the busybox-cvs
mailing list