Darren,
There are two reasons for which I do not agree.
1) The ill_hdr_length member of struct ill_t is defined only
when SOLARIS2 < 8. You can't use ill->ill_hdr_length in
Solaris8 or above.
2) If I'd use this condition the whole code would be(suppose it
is in solaris7 or below). I think the second condition
Is not needed. I mean if ill->ill_hdr_length IS 0, qif->qf_hl will not
be modified anyway(it is 0 already).
if (qif->qf_hl == 0 && ill->ill_hdr_length != 0)
{
qif->qf_hl = ill->ill_hdr_length;
}
So, here my question is do you mean '||' instead of '&&' like
the following line?
if (qif->qf_hl == 0 || ill->ill_hdr_length != 0)
If so, the codes shall be
#if SOLARIS2 < 8
If (qif->qf_hl == 0 || ill->ill_hdr_length != 0){
qif->qf_hl = ill->ill_hdr_length;
}
#else
if ((qif->qf_hl == 0) || ((ill->ill_type > 0) && (ill->ill_type
< 0x37) &&
(hdrsizes[ill->ill_type][0] == ill->ill_type) &&
(hdrsizes[ill->ill_type][1] != 0)))
qif->qf_hl = hdrsizes[ill->ill_type][1];
if (qif->qf_hl == 0 && ill->ill_type != IFT_OTHER) {
cmn_err(CE_WARN,
"!Unknown layer 2 header size for %s type %d sap
%x\n",
qif->qf_name, ill->ill_type, ill->ill_sap);
}
#endif
These codes also works. Which one do you prefer?
Regards,
Sander
-----Original Message-----
From: Darren Reed [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 20, 2007 14:29 PM
To: Zang, Lan (Sander)
Cc: [EMAIL PROTECTED]; [email protected]
Subject: Re: IPsec Tunnel problem seek confirm from author or anyone
knows
Does it work for you if you change your if() to be:
if (qif->qf_hl == 0 && ill->ill_hdr_length != 0)
?
Darren