aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/drivers/pcap_kern.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/drivers/pcap_kern.c')
-rw-r--r--arch/um/drivers/pcap_kern.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/arch/um/drivers/pcap_kern.c b/arch/um/drivers/pcap_kern.c
index 948849343ca4..8b27eae357ef 100644
--- a/arch/um/drivers/pcap_kern.c
+++ b/arch/um/drivers/pcap_kern.c
@@ -29,21 +29,25 @@ void pcap_init(struct net_device *dev, void *data)
29 ppri->promisc = init->promisc; 29 ppri->promisc = init->promisc;
30 ppri->optimize = init->optimize; 30 ppri->optimize = init->optimize;
31 ppri->filter = init->filter; 31 ppri->filter = init->filter;
32
33 printk("pcap backend, host interface %s\n", ppri->host_if);
32} 34}
33 35
34static int pcap_read(int fd, struct sk_buff **skb, 36static int pcap_read(int fd, struct sk_buff **skb,
35 struct uml_net_private *lp) 37 struct uml_net_private *lp)
36{ 38{
37 *skb = ether_adjust_skb(*skb, ETH_HEADER_OTHER); 39 *skb = ether_adjust_skb(*skb, ETH_HEADER_OTHER);
38 if(*skb == NULL) return(-ENOMEM); 40 if(*skb == NULL)
39 return(pcap_user_read(fd, skb_mac_header(*skb), 41 return -ENOMEM;
42
43 return pcap_user_read(fd, skb_mac_header(*skb),
40 (*skb)->dev->mtu + ETH_HEADER_OTHER, 44 (*skb)->dev->mtu + ETH_HEADER_OTHER,
41 (struct pcap_data *) &lp->user)); 45 (struct pcap_data *) &lp->user);
42} 46}
43 47
44static int pcap_write(int fd, struct sk_buff **skb, struct uml_net_private *lp) 48static int pcap_write(int fd, struct sk_buff **skb, struct uml_net_private *lp)
45{ 49{
46 return(-EPERM); 50 return -EPERM;
47} 51}
48 52
49static const struct net_kern_info pcap_kern_info = { 53static const struct net_kern_info pcap_kern_info = {
@@ -65,12 +69,12 @@ int pcap_setup(char *str, char **mac_out, void *data)
65 .optimize = 0, 69 .optimize = 0,
66 .filter = NULL }); 70 .filter = NULL });
67 71
68 remain = split_if_spec(str, &host_if, &init->filter, 72 remain = split_if_spec(str, &host_if, &init->filter,
69 &options[0], &options[1], NULL); 73 &options[0], &options[1], NULL);
70 if(remain != NULL){ 74 if(remain != NULL){
71 printk(KERN_ERR "pcap_setup - Extra garbage on " 75 printk(KERN_ERR "pcap_setup - Extra garbage on "
72 "specification : '%s'\n", remain); 76 "specification : '%s'\n", remain);
73 return(0); 77 return 0;
74 } 78 }
75 79
76 if(host_if != NULL) 80 if(host_if != NULL)
@@ -87,10 +91,13 @@ int pcap_setup(char *str, char **mac_out, void *data)
87 init->optimize = 1; 91 init->optimize = 1;
88 else if(!strcmp(options[i], "nooptimize")) 92 else if(!strcmp(options[i], "nooptimize"))
89 init->optimize = 0; 93 init->optimize = 0;
90 else printk("pcap_setup : bad option - '%s'\n", options[i]); 94 else {
95 printk("pcap_setup : bad option - '%s'\n", options[i]);
96 return 0;
97 }
91 } 98 }
92 99
93 return(1); 100 return 1;
94} 101}
95 102
96static struct transport pcap_transport = { 103static struct transport pcap_transport = {