Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix type to prevent implicit type conversion: uint32_t instead of uint16_t #271

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ChrisMuc
Copy link

@ChrisMuc ChrisMuc commented Jul 9, 2021

This pull request fixes an implicit type conversion in ofp_netif.c, where an uint16_t is used instead of an uint32_t.

Background and impact of this bug:
pcap-implementation (in pcap.c) of pktio interface initializes mtu-size with: pcap->mtu = PKTIO_PCAP_MTU_MAX;
whereas PKTIO_PCAP_MTU_MAX is defined as: #define PKTIO_PCAP_MTU_MAX (64 * 1024).
64*1024 = 0x00010000, when casted to uint16_t this is 0.
Using the pcap implementation causes the following error:

I 50 0:585118208 ofp_init.c:438] Slow path threads on core 0
I 52 0:585118208 ofp_ifnet.c:214] Device 'pcap:out=test_out.pcap' addr  02:e9:34:80:73:04
E 52 0:585118208 ofp_ifnet.c:231] odp_pktout_maxlen returned too small value: 0
Error: OFP global init failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant