Skip to contentSkip to conversation

net: ioctl SIOCSIFADDR minor cleanup

PATCH Superseded yuan linyu 2 participants 2 messages Nov 11, 2016 – Nov 13, 2016

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

yuan linyu

author
#0 lore raw

PATCH 1/1 net: ioctl SIOCSIFADDR minor cleanup

From: yuan linyu <[email protected]>

1. set interface address label to ioctl request device name is enough
2. when address pass inet_abc_len check, prefixlen less than 31 is always true

---
 net/ipv4/devinet.c | 8 ++------

 1 file changed, 2 insertions(+), 6 deletions(-)
net/ipv4/devinet.c +0 -0
index 062a67c..d491a7a 100644
@@ -1063,10 +1063,7 @@ int devinet_ioctl(struct net *net, unsigned int cmd, void

__user *arg)
  if (!ifa)
  break; INIT_HLIST_NODE(&ifa->hash);
- if (colon)
- memcpy(ifa->ifa_label, ifr.ifr_name, IFNAMSIZ);
- else
- memcpy(ifa->ifa_label, dev->name, IFNAMSIZ);
+ memcpy(ifa->ifa_label, ifr.ifr_name, IFNAMSIZ);
  } else {
  ret = 0;
  if (ifa->ifa_local == sin->sin_addr.s_addr) @@ -1081,8 +1078,7 @@ int devinet_ioctl(struct net *net, unsigned int cmd, void __user *arg)
  if (!(dev->flags & IFF_POINTOPOINT)) { ifa->ifa_prefixlen = inet_abc_len(ifa->ifa_address); ifa->ifa_mask = inet_make_mask(ifa->ifa_prefixlen);
- if ((dev->flags & IFF_BROADCAST) &&
-     ifa->ifa_prefixlen < 31)
+ if (dev->flags & IFF_BROADCAST)
  ifa->ifa_broadcast = ifa->ifa_address | ~ifa->ifa_mask; } else {
--
2.7.4

maintainer
#1 lore raw

Your patch was mangled by your email client, chopping up long lines and turning TAB characters into spaces.

Please fix this, email a test patch to yourself, and do not resubmit your change until you can successfully apply the patch you receive in a test email. Also, do not try using attachments to fix this problem, patches must be inline.