diff options
Diffstat (limited to 'arch/um/drivers/pcap_kern.c')
-rw-r--r-- | arch/um/drivers/pcap_kern.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/arch/um/drivers/pcap_kern.c b/arch/um/drivers/pcap_kern.c index c329931673d6..da0403efbc0d 100644 --- a/arch/um/drivers/pcap_kern.c +++ b/arch/um/drivers/pcap_kern.c | |||
@@ -1,13 +1,11 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2002 Jeff Dike <jdike@karaya.com> | 2 | * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) |
3 | * Licensed under the GPL. | 3 | * Licensed under the GPL. |
4 | */ | 4 | */ |
5 | 5 | ||
6 | #include "linux/init.h" | 6 | #include "linux/init.h" |
7 | #include "linux/netdevice.h" | 7 | #include <linux/netdevice.h> |
8 | #include "linux/etherdevice.h" | ||
9 | #include "net_kern.h" | 8 | #include "net_kern.h" |
10 | #include "net_user.h" | ||
11 | #include "pcap_user.h" | 9 | #include "pcap_user.h" |
12 | 10 | ||
13 | struct pcap_init { | 11 | struct pcap_init { |
@@ -37,7 +35,7 @@ static int pcap_read(int fd, struct sk_buff **skb, | |||
37 | struct uml_net_private *lp) | 35 | struct uml_net_private *lp) |
38 | { | 36 | { |
39 | *skb = ether_adjust_skb(*skb, ETH_HEADER_OTHER); | 37 | *skb = ether_adjust_skb(*skb, ETH_HEADER_OTHER); |
40 | if(*skb == NULL) | 38 | if (*skb == NULL) |
41 | return -ENOMEM; | 39 | return -ENOMEM; |
42 | 40 | ||
43 | return pcap_user_read(fd, skb_mac_header(*skb), | 41 | return pcap_user_read(fd, skb_mac_header(*skb), |
@@ -71,28 +69,29 @@ int pcap_setup(char *str, char **mac_out, void *data) | |||
71 | 69 | ||
72 | remain = split_if_spec(str, &host_if, &init->filter, | 70 | remain = split_if_spec(str, &host_if, &init->filter, |
73 | &options[0], &options[1], mac_out, NULL); | 71 | &options[0], &options[1], mac_out, NULL); |
74 | if(remain != NULL){ | 72 | if (remain != NULL) { |
75 | printk(KERN_ERR "pcap_setup - Extra garbage on " | 73 | printk(KERN_ERR "pcap_setup - Extra garbage on " |
76 | "specification : '%s'\n", remain); | 74 | "specification : '%s'\n", remain); |
77 | return 0; | 75 | return 0; |
78 | } | 76 | } |
79 | 77 | ||
80 | if(host_if != NULL) | 78 | if (host_if != NULL) |
81 | init->host_if = host_if; | 79 | init->host_if = host_if; |
82 | 80 | ||
83 | for(i = 0; i < ARRAY_SIZE(options); i++){ | 81 | for (i = 0; i < ARRAY_SIZE(options); i++) { |
84 | if(options[i] == NULL) | 82 | if (options[i] == NULL) |
85 | continue; | 83 | continue; |
86 | if(!strcmp(options[i], "promisc")) | 84 | if (!strcmp(options[i], "promisc")) |
87 | init->promisc = 1; | 85 | init->promisc = 1; |
88 | else if(!strcmp(options[i], "nopromisc")) | 86 | else if (!strcmp(options[i], "nopromisc")) |
89 | init->promisc = 0; | 87 | init->promisc = 0; |
90 | else if(!strcmp(options[i], "optimize")) | 88 | else if (!strcmp(options[i], "optimize")) |
91 | init->optimize = 1; | 89 | init->optimize = 1; |
92 | else if(!strcmp(options[i], "nooptimize")) | 90 | else if (!strcmp(options[i], "nooptimize")) |
93 | init->optimize = 0; | 91 | init->optimize = 0; |
94 | else { | 92 | else { |
95 | printk("pcap_setup : bad option - '%s'\n", options[i]); | 93 | printk(KERN_ERR "pcap_setup : bad option - '%s'\n", |
94 | options[i]); | ||
96 | return 0; | 95 | return 0; |
97 | } | 96 | } |
98 | } | 97 | } |