mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-10-04 08:56:42 +00:00
fix sheep_net Linux kernel panic on n2n edge0 tap device
This commit is contained in:
parent
eb3ef0bd01
commit
d77100ae1f
@ -425,6 +425,11 @@ static ssize_t sheep_net_read(struct file *f, char *buf, size_t count, loff_t *o
|
|||||||
* Driver write() function
|
* Driver write() function
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
static inline void do_nothing(struct sk_buff *skb)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
static ssize_t sheep_net_write(struct file *f, const char *buf, size_t count, loff_t *off)
|
static ssize_t sheep_net_write(struct file *f, const char *buf, size_t count, loff_t *off)
|
||||||
{
|
{
|
||||||
struct SheepVars *v = (struct SheepVars *)f->private_data;
|
struct SheepVars *v = (struct SheepVars *)f->private_data;
|
||||||
@ -498,6 +503,7 @@ static ssize_t sheep_net_write(struct file *f, const char *buf, size_t count, lo
|
|||||||
/* Outgoing packet (will be on the net) */
|
/* Outgoing packet (will be on the net) */
|
||||||
demasquerade(v, skb);
|
demasquerade(v, skb);
|
||||||
|
|
||||||
|
skb->destructor = do_nothing;
|
||||||
skb->protocol = PROT_MAGIC; /* Magic value (we can recognize the packet in sheep_net_receiver) */
|
skb->protocol = PROT_MAGIC; /* Magic value (we can recognize the packet in sheep_net_receiver) */
|
||||||
dev_queue_xmit(skb);
|
dev_queue_xmit(skb);
|
||||||
return count;
|
return count;
|
||||||
|
Loading…
Reference in New Issue
Block a user