diff options
| author | Yaroslav Tykhiy <ytykhiy@gmail.com> | 2005-08-31 11:36:50 +0000 |
|---|---|---|
| committer | Yaroslav Tykhiy <ytykhiy@gmail.com> | 2005-08-31 11:36:50 +0000 |
| commit | eefbcf0e620e0ccb48a98f854aa96c34f8018678 (patch) | |
| tree | 84a8bfd45590a638afe97a040f869b58ff7e417d /sys/net/if_vlan_var.h | |
| parent | a3a90a725c59d6ca2a4c090d51bc1ffcd65c94bb (diff) | |
Notes
Diffstat (limited to 'sys/net/if_vlan_var.h')
| -rw-r--r-- | sys/net/if_vlan_var.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/net/if_vlan_var.h b/sys/net/if_vlan_var.h index 11cbf7b20fcf..c55d5d1ec555 100644 --- a/sys/net/if_vlan_var.h +++ b/sys/net/if_vlan_var.h @@ -96,6 +96,12 @@ struct vlanreq { #define MTAG_VLAN 1035328035 #define MTAG_VLAN_TAG 0 /* tag of VLAN interface */ +/* + * This macro must expand to a lvalue so that it can be used + * to set a tag with a simple assignment. + */ +#define VLAN_TAG_VALUE(_mt) (*(u_int *)((_mt) + 1)) + #define VLAN_INPUT_TAG(_ifp, _m, _t, _errcase) do { \ struct m_tag *mtag; \ mtag = m_tag_alloc(MTAG_VLAN, MTAG_VLAN_TAG, \ @@ -105,7 +111,7 @@ struct vlanreq { m_freem(_m); \ _errcase; \ } \ - *(u_int *)(mtag+1) = (_t); \ + VLAN_TAG_VALUE(mtag) = (_t); \ m_tag_prepend((_m), mtag); \ (_m)->m_flags |= M_VLANTAG; \ } while (0) @@ -113,7 +119,6 @@ struct vlanreq { #define VLAN_OUTPUT_TAG(_ifp, _m) \ ((_m)->m_flags & M_VLANTAG ? \ m_tag_locate((_m), MTAG_VLAN, MTAG_VLAN_TAG, NULL) : NULL) -#define VLAN_TAG_VALUE(_mt) (*(u_int *)((_mt)+1)) #endif /* _KERNEL */ #endif /* _NET_IF_VLAN_VAR_H_ */ |
