[IPV6] SIT: Disallow 0.0.0.0 in PRL and Flush PRL if given for DEL.
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Sat, 22 Mar 2008 08:50:59 +0000 (17:50 +0900)
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Thu, 3 Apr 2008 01:05:59 +0000 (10:05 +0900)
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
net/ipv6/sit.c

index ee0cc28516915a12738323cb7359188bd5e44233..84c1ed246afbe1d8eff4393092e3433289b2423b 100644 (file)
@@ -215,6 +215,9 @@ ipip6_tunnel_add_prl(struct ip_tunnel *t, struct ip_tunnel_prl *a, int chg)
        struct ip_tunnel_prl_entry *p;
        int err = 0;
 
+       if (a->addr == htonl(INADDR_ANY))
+               return -EINVAL;
+
        write_lock(&ipip6_lock);
 
        for (p = t->prl; p; p = p->next) {
@@ -254,7 +257,7 @@ ipip6_tunnel_del_prl(struct ip_tunnel *t, struct ip_tunnel_prl *a)
 
        write_lock(&ipip6_lock);
 
-       if (a) {
+       if (a && a->addr != htonl(INADDR_ANY)) {
                for (p = &t->prl; *p; p = &(*p)->next) {
                        if ((*p)->entry.addr == a->addr) {
                                x = *p;