| To: | davem@xxxxxxxxxxxxx, jgarzik@xxxxxxxxx |
|---|---|
| Subject: | [patch] devinet: cleanup if statements |
| From: | pmeda@xxxxxxxxxx |
| Date: | Tue, 7 Jun 2005 13:32:44 -0700 |
| Cc: | akpm@xxxxxxxx, netdev@xxxxxxxxxxx |
| Sender: | netdev-bounce@xxxxxxxxxxx |
Cleanup the devinet if statements.
- when there is no colon, interface name is same as device.
- ifa_label is an array, not a pointer, and so can never be null.
Signed-Off-by: Prasanna Meda <pmeda@xxxxxxxxxx>
--- a/net/ipv4/devinet.c Wed Jun 1 23:54:37 2005
+++ b/net/ipv4/devinet.c Wed Jun 1 23:57:16 2005
@@ -636,10 +636,7 @@
ret = -ENOBUFS;
if ((ifa = inet_alloc_ifa()) == NULL)
break;
- 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)
@@ -746,10 +743,7 @@
if (len < (int) sizeof(ifr))
break;
memset(&ifr, 0, sizeof(struct ifreq));
- if (ifa->ifa_label)
- strcpy(ifr.ifr_name, ifa->ifa_label);
- else
- strcpy(ifr.ifr_name, dev->name);
+ strcpy(ifr.ifr_name, ifa->ifa_label);
(*(struct sockaddr_in *)&ifr.ifr_addr).sin_family = AF_INET;
(*(struct sockaddr_in *)&ifr.ifr_addr).sin_addr.s_addr =
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: RFC: NAPI packet weighting patch, David S. Miller |
|---|---|
| Next by Date: | 2.6.12-rc6-tcp1, Stephen Hemminger |
| Previous by Thread: | [PATCH 7/7] [PKT_SCHED]: noop/noqueue qdisc style cleanups, Thomas Graf |
| Next by Thread: | Re: [patch] devinet: cleanup if statements, David S. Miller |
| Indexes: | [Date] [Thread] [Top] [All Lists] |