[lldp-devel] [PATCH 1/2] vdpnl: initialize vdpnl_mac to prevent segfault

John Fastabend john.fastabend at gmail.com
Tue Nov 19 08:58:58 UTC 2013


On 11/14/2013 01:20 AM, Thomas-Mich Richter wrote:
> On 11/13/2013 10:10 PM, Philbert Lin wrote:
>> In the vdptest man pages the following profile is given as an example:
>>
>> 	name=thomas2,mgrid=1,typeid=123452,typeidver=1,hints=none\
>> 		uuid=a1412857-60f7-4ce1-e95a-2164943f53dd,\
>> 		map=2-52:54:00:8e:50:53-9999,map=0/10-52:54:00:8e:50:54-8888
>>
>> When this profile is used as a basic test, it causes lldpad to segfault
>> and vdptest to fail. The command used is:
>
> Your are correct. When I submitted the changes to the vdptest program to
> support VPD22 protocol, I started with my test program vdptest.c. I assumed
> I was the only one using it and have submitted the changes.
> To fully support the message format for VDP22 and especially the return
> of changed VLAN Ids and QoS values, I need the change the netlink messages
> used to communicate from libvirtd/vdptest to lldpad. To test this I needed
> a modified vdptest.c test program to support the input to lldpad.
>
> The changes have to be done in a backward compatible way, because libvirtd is still
> using draft 0.2 of the IEEE 802.1 Qbg standard.
>
> I have discussed the new netlink message format with John and have implemented
> it in the past few week (on a low priority). I have done extensive testing and
> have also discovered some issue which I fixed and submitted to the mailing list
> earlier this week.
>
> I am now polishing the qbg/vdpnl.c and include/qbg_vdpnl.h files to fully support
> the features introduces and exploited by vdptest.c. I should be done in a few days
> and will post the patches.
>
>>
>> 	sudo ./vdptest -i eth5 -Aname=thomas2,mgrid=1,typeid=123452,\
>> 	typeidver=1,hints=none,uuid=a1412857-60f7-4ce1-e95a-2164943f53dd,\
>> 	map=2-52:54:00:8e:50:53-9999,map=0/10-52:54:00:8e:50:54-8888\
>> 	-a thomas2,w=10,r=2
>>
>> If vlan == 0 then vdp22_alloc_vsi() sets the VDP22_RETURN_VID flag and
>> in vdp22_status the following code is performed (and maclist == NULL):
>>
>> 	if (p->flags & VDP22_RETURN_VID) {
>> 		vsi->maclist->vlan = p->fdata[0].vlan;
>> 		...
>> 	}
>>
>> The attached changes assume that there is only one MAC/VLAN pair but it
>> seems consistent with the existing code.
>
> Your patch is ok. It will handle one VLAN 0 case and makes the example not
> crashing lldpad . So we should commit it even when I will post a  reworked version
> soon.
>
>

Applied, thanks for the fix.


-- 
John Fastabend         Intel Corporation


More information about the lldp-devel mailing list