aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/8021q/vlan.c2
-rw-r--r--net/core/dev.c6
-rw-r--r--net/ipv4/devinet.c3
-rw-r--r--net/ipv4/esp4.c5
-rw-r--r--net/ipv6/esp6.c6
-rw-r--r--net/ipv6/xfrm6_policy.c2
-rw-r--r--net/xfrm/xfrm_policy.c9
7 files changed, 22 insertions, 11 deletions
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 5b183156307a..4add9bd4bc8d 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -124,8 +124,8 @@ static void __exit vlan_cleanup_module(void)
124{ 124{
125 int i; 125 int i;
126 126
127 vlan_netlink_fini();
128 vlan_ioctl_set(NULL); 127 vlan_ioctl_set(NULL);
128 vlan_netlink_fini();
129 129
130 /* Un-register us from receiving netdevice events */ 130 /* Un-register us from receiving netdevice events */
131 unregister_netdevice_notifier(&vlan_notifier_block); 131 unregister_netdevice_notifier(&vlan_notifier_block);
diff --git a/net/core/dev.c b/net/core/dev.c
index 86d62611f2fc..26a3a3a15be0 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3972,8 +3972,7 @@ void synchronize_net(void)
3972 * @dev: device 3972 * @dev: device
3973 * 3973 *
3974 * This function shuts down a device interface and removes it 3974 * This function shuts down a device interface and removes it
3975 * from the kernel tables. On success 0 is returned, on a failure 3975 * from the kernel tables.
3976 * a negative errno code is returned.
3977 * 3976 *
3978 * Callers must hold the rtnl semaphore. You may want 3977 * Callers must hold the rtnl semaphore. You may want
3979 * unregister_netdev() instead of this. 3978 * unregister_netdev() instead of this.
@@ -3991,8 +3990,7 @@ void unregister_netdevice(struct net_device *dev)
3991 * @dev: device 3990 * @dev: device
3992 * 3991 *
3993 * This function shuts down a device interface and removes it 3992 * This function shuts down a device interface and removes it
3994 * from the kernel tables. On success 0 is returned, on a failure 3993 * from the kernel tables.
3995 * a negative errno code is returned.
3996 * 3994 *
3997 * This is just a wrapper for unregister_netdevice that takes 3995 * This is just a wrapper for unregister_netdevice that takes
3998 * the rtnl semaphore. In general you want to use this and not 3996 * the rtnl semaphore. In general you want to use this and not
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 55d199e4ae21..3168c3de4919 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -516,8 +516,6 @@ static struct in_ifaddr *rtm_to_ifaddr(struct nlmsghdr *nlh)
516 goto errout; 516 goto errout;
517 } 517 }
518 518
519 ipv4_devconf_setall(in_dev);
520
521 ifa = inet_alloc_ifa(); 519 ifa = inet_alloc_ifa();
522 if (ifa == NULL) { 520 if (ifa == NULL) {
523 /* 521 /*
@@ -528,6 +526,7 @@ static struct in_ifaddr *rtm_to_ifaddr(struct nlmsghdr *nlh)
528 goto errout; 526 goto errout;
529 } 527 }
530 528
529 ipv4_devconf_setall(in_dev);
531 in_dev_hold(in_dev); 530 in_dev_hold(in_dev);
532 531
533 if (tb[IFA_ADDRESS] == NULL) 532 if (tb[IFA_ADDRESS] == NULL)
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c
index c31bccb9b526..1738113268bc 100644
--- a/net/ipv4/esp4.c
+++ b/net/ipv4/esp4.c
@@ -9,6 +9,7 @@
9#include <linux/pfkeyv2.h> 9#include <linux/pfkeyv2.h>
10#include <linux/random.h> 10#include <linux/random.h>
11#include <linux/spinlock.h> 11#include <linux/spinlock.h>
12#include <linux/in6.h>
12#include <net/icmp.h> 13#include <net/icmp.h>
13#include <net/protocol.h> 14#include <net/protocol.h>
14#include <net/udp.h> 15#include <net/udp.h>
@@ -224,6 +225,10 @@ static int esp_input(struct xfrm_state *x, struct sk_buff *skb)
224 225
225 /* ... check padding bits here. Silly. :-) */ 226 /* ... check padding bits here. Silly. :-) */
226 227
228 /* RFC4303: Drop dummy packets without any error */
229 if (nexthdr[1] == IPPROTO_NONE)
230 goto out;
231
227 iph = ip_hdr(skb); 232 iph = ip_hdr(skb);
228 ihl = iph->ihl * 4; 233 ihl = iph->ihl * 4;
229 234
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index 7db66f10e00d..444053254676 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -230,6 +230,12 @@ static int esp6_input(struct xfrm_state *x, struct sk_buff *skb)
230 } 230 }
231 /* ... check padding bits here. Silly. :-) */ 231 /* ... check padding bits here. Silly. :-) */
232 232
233 /* RFC4303: Drop dummy packets without any error */
234 if (nexthdr[1] == IPPROTO_NONE) {
235 ret = -EINVAL;
236 goto out;
237 }
238
233 pskb_trim(skb, skb->len - alen - padlen - 2); 239 pskb_trim(skb, skb->len - alen - padlen - 2);
234 ret = nexthdr[1]; 240 ret = nexthdr[1];
235 } 241 }
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
index 82e27b80d07d..b8e9eb445d74 100644
--- a/net/ipv6/xfrm6_policy.c
+++ b/net/ipv6/xfrm6_policy.c
@@ -233,7 +233,7 @@ __xfrm6_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int
233 dst_prev->output = dst_prev->xfrm->outer_mode->afinfo->output; 233 dst_prev->output = dst_prev->xfrm->outer_mode->afinfo->output;
234 /* Sheit... I remember I did this right. Apparently, 234 /* Sheit... I remember I did this right. Apparently,
235 * it was magically lost, so this code needs audit */ 235 * it was magically lost, so this code needs audit */
236 x->u.rt6.rt6i_flags = rt0->rt6i_flags&(RTCF_BROADCAST|RTCF_MULTICAST|RTCF_LOCAL); 236 x->u.rt6.rt6i_flags = rt0->rt6i_flags&(RTF_ANYCAST|RTF_LOCAL);
237 x->u.rt6.rt6i_metric = rt0->rt6i_metric; 237 x->u.rt6.rt6i_metric = rt0->rt6i_metric;
238 x->u.rt6.rt6i_node = rt0->rt6i_node; 238 x->u.rt6.rt6i_node = rt0->rt6i_node;
239 x->u.rt6.rt6i_gateway = rt0->rt6i_gateway; 239 x->u.rt6.rt6i_gateway = rt0->rt6i_gateway;
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 9a4cf2e45a15..b91b16671c1e 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -1318,8 +1318,9 @@ restart:
1318 1318
1319 if (sk && sk->sk_policy[XFRM_POLICY_OUT]) { 1319 if (sk && sk->sk_policy[XFRM_POLICY_OUT]) {
1320 policy = xfrm_sk_policy_lookup(sk, XFRM_POLICY_OUT, fl); 1320 policy = xfrm_sk_policy_lookup(sk, XFRM_POLICY_OUT, fl);
1321 err = PTR_ERR(policy);
1321 if (IS_ERR(policy)) 1322 if (IS_ERR(policy))
1322 return PTR_ERR(policy); 1323 goto dropdst;
1323 } 1324 }
1324 1325
1325 if (!policy) { 1326 if (!policy) {
@@ -1330,8 +1331,9 @@ restart:
1330 1331
1331 policy = flow_cache_lookup(fl, dst_orig->ops->family, 1332 policy = flow_cache_lookup(fl, dst_orig->ops->family,
1332 dir, xfrm_policy_lookup); 1333 dir, xfrm_policy_lookup);
1334 err = PTR_ERR(policy);
1333 if (IS_ERR(policy)) 1335 if (IS_ERR(policy))
1334 return PTR_ERR(policy); 1336 goto dropdst;
1335 } 1337 }
1336 1338
1337 if (!policy) 1339 if (!policy)
@@ -1501,8 +1503,9 @@ restart:
1501 return 0; 1503 return 0;
1502 1504
1503error: 1505error:
1504 dst_release(dst_orig);
1505 xfrm_pols_put(pols, npols); 1506 xfrm_pols_put(pols, npols);
1507dropdst:
1508 dst_release(dst_orig);
1506 *dst_p = NULL; 1509 *dst_p = NULL;
1507 return err; 1510 return err;
1508} 1511}