1

I'm trying to write an IS-IS packet to gretap interface with ISO (0x00fe) protocol type. In this case there is no ethernet header so I'm using raw socket. The gretap always puts 0x6558 as the protocol type in the GRE header, is there a way I can make gretap use a different protocol type (ie 0x00fe) so the receiver is expecting to see IS-IS packet immediately after the GRE header (ie no ethernet header first)?

Follow-up:

I think the protocol type is hard-coded, ie (from ip_gre.c in kernel):

 761 static netdev_tx_t gre_tap_xmit(struct sk_buff *skb,
 762         struct net_device *dev)
 763 {
...
 776
 777   __gre_xmit(skb, dev, &tunnel->parms.iph, htons(ETH_P_TEB));
 778   return NETDEV_TX_OK;

The symbol ETH_P_TEB is the transparent ethernet bridge type (0x6558), so there's no option to set this value. This is unfortunate because if using raw socket we might want to generate a different encapsulation over the GRE. I will try modding the kernel module.

1 Answer 1

1

Looks like I can accomplish what I want using IP gre interface and raw socket, rather than gretap. The protocol type is settable in that case using sll_protocol field of struct sockaddr_ll passed in sendto() call, and using raw socket allows control of the encapsulation.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .