Skip to content

Commit

Permalink
af_packet: use define instead of constant
Browse files Browse the repository at this point in the history
Instead of using a hard-coded value for the status variable, it would make
the code more readable to use its destined define from linux/if_packet.h.

Signed-off-by: [email protected]
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
[email protected] authored and davem330 committed Aug 23, 2012
1 parent bfdc587 commit 9e67030
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/packet/af_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,8 @@ static void prb_fill_vlan_info(struct tpacket_kbdq_core *pkc,
ppd->hv1.tp_vlan_tci = vlan_tx_tag_get(pkc->skb);
ppd->tp_status = TP_STATUS_VLAN_VALID;
} else {
ppd->hv1.tp_vlan_tci = ppd->tp_status = 0;
ppd->hv1.tp_vlan_tci = 0;
ppd->tp_status = TP_STATUS_AVAILABLE;
}
}

Expand Down Expand Up @@ -1951,7 +1952,7 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg)
int tp_len, size_max;
unsigned char *addr;
int len_sum = 0;
int status = 0;
int status = TP_STATUS_AVAILABLE;
int hlen, tlen;

mutex_lock(&po->pg_vec_lock);
Expand Down

0 comments on commit 9e67030

Please sign in to comment.