aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-04-26 02:22:19 +0000
committerbug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-04-26 02:22:19 +0000
commit6e8ada21dfb22049db8dfb3c8a442d8242e4f0cb (patch)
treecb195f87e401bf7356964a4ca1998143a9845d8e
parent37444f9ec0b86c399c4ed10abc26d7739b2f2a64 (diff)
downloadbusybox-w32-6e8ada21dfb22049db8dfb3c8a442d8242e4f0cb.tar.gz
busybox-w32-6e8ada21dfb22049db8dfb3c8a442d8242e4f0cb.tar.bz2
busybox-w32-6e8ada21dfb22049db8dfb3c8a442d8242e4f0cb.zip
iPatch from waldi, fixes usage of ip route flush (from)? (match|exact)
git-svn-id: svn://busybox.net/trunk/busybox@6813 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--networking/libiproute/iproute.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c
index 3dcafdb6f..70ddf9f41 100644
--- a/networking/libiproute/iproute.c
+++ b/networking/libiproute/iproute.c
@@ -72,6 +72,8 @@ static int print_route(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
72 int len = n->nlmsg_len; 72 int len = n->nlmsg_len;
73 struct rtattr * tb[RTA_MAX+1]; 73 struct rtattr * tb[RTA_MAX+1];
74 char abuf[256]; 74 char abuf[256];
75 inet_prefix dst;
76 inet_prefix src;
75 int host_len = -1; 77 int host_len = -1;
76 SPRINT_BUF(b1); 78 SPRINT_BUF(b1);
77 79
@@ -144,6 +146,18 @@ static int print_route(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
144 memset(tb, 0, sizeof(tb)); 146 memset(tb, 0, sizeof(tb));
145 parse_rtattr(tb, RTA_MAX, RTM_RTA(r), len); 147 parse_rtattr(tb, RTA_MAX, RTM_RTA(r), len);
146 148
149 if (filter.rdst.family && inet_addr_match(&dst, &filter.rdst, filter.rdst.bitlen))
150 return 0;
151 if (filter.mdst.family && filter.mdst.bitlen >= 0 &&
152 inet_addr_match(&dst, &filter.mdst, r->rtm_dst_len))
153 return 0;
154
155 if (filter.rsrc.family && inet_addr_match(&src, &filter.rsrc, filter.rsrc.bitlen))
156 return 0;
157 if (filter.msrc.family && filter.msrc.bitlen >= 0 &&
158 inet_addr_match(&src, &filter.msrc, r->rtm_src_len))
159 return 0;
160
147 if (filter.flushb && 161 if (filter.flushb &&
148 r->rtm_family == AF_INET6 && 162 r->rtm_family == AF_INET6 &&
149 r->rtm_dst_len == 0 && 163 r->rtm_dst_len == 0 &&