diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-05-08 00:35:04 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 11:15:20 -0700 |
commit | 7d98230a73c21b4d0cee9c3aca38190d215e0e39 (patch) | |
tree | c2a5b5ff2e7927c3519ed49c3cb907ee29a5a90a /arch/um/drivers/net_kern.c | |
parent | a436ed9c5106b41606cbb55ab3b28389fe8ae04f (diff) | |
download | op-kernel-dev-7d98230a73c21b4d0cee9c3aca38190d215e0e39.zip op-kernel-dev-7d98230a73c21b4d0cee9c3aca38190d215e0e39.tar.gz |
uml: network and pcap cleanup
Some network device cleanup.
When setup_etheraddr found a globally valid MAC being assigned to an
interface, it went ahead and used it rather than assigning a random MAC like
the other cases do. This isn't really an error like the others, but it seems
consistent to make it behave the same.
We were getting some duplicate kfree() in the error case in eth_configure
because platform_device_unregister frees buffers that the error cases
following tried to free again.
The pcap initialization routine wasn't doing the proper printk of its
information, causing a printk of the first part of that line to be
unterminated by a newline.
The pcap code had a bunch of style violations, which are now fixed.
pcap_setup wasn't returning false when it detected an unrecognized
option.
The printks in pcap_user all got UM_KERN_BLAH prepended to their
format strings.
pcap_remove now checks for a non-NULL pcap structure before it calls
pcap_close.
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Acked-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/drivers/net_kern.c')
-rw-r--r-- | arch/um/drivers/net_kern.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c index baac4ad..72773dd 100644 --- a/arch/um/drivers/net_kern.c +++ b/arch/um/drivers/net_kern.c @@ -316,12 +316,14 @@ static void setup_etheraddr(char *str, unsigned char *addr, char *name) } if (!is_local_ether_addr(addr)) { printk(KERN_WARNING - "Warning: attempt to assign a globally valid ethernet address to a " - "device\n"); - printk(KERN_WARNING "You should better enable the 2nd rightmost bit " - "in the first byte of the MAC, i.e. " - "%02x:%02x:%02x:%02x:%02x:%02x\n", - addr[0] | 0x02, addr[1], addr[2], addr[3], addr[4], addr[5]); + "Warning: attempt to assign a globally valid ethernet " + "address to a device\n"); + printk(KERN_WARNING "You should better enable the 2nd " + "rightmost bit in the first byte of the MAC,\n"); + printk(KERN_WARNING "i.e. %02x:%02x:%02x:%02x:%02x:%02x\n", + addr[0] | 0x02, addr[1], addr[2], addr[3], addr[4], + addr[5]); + goto random; } return; @@ -478,6 +480,7 @@ out_undo_user_init: (*transport->user->remove)(&lp->user); out_unregister: platform_device_unregister(&device->pdev); + return; /* platform_device_unregister frees dev and device */ out_free_netdev: free_netdev(dev); out_free_device: |