Hi Ravi,
when I faced the necessity to support multiple IP addresses I didn't thought that was possible to open multiple interfaces; Nichestack documentation provides that is possible to have multiple interfaces (multi - homed) only if you have really more that one physical interfaces (they do the example with serial and phy devices). If you are trying to implement that solution I suppose that you verified it is possible; just for example check if is possible to handle 4 intefaces with 8 SGDMA and only one TSE.
Anyway as you requested me I provide you where I modified Nichestack: basically everywhere IP address (and subnet, etc...) of received packet is checked comparing it with interface one. The rule I've followed is to substitute check on inteface IP address with a loop of check with my list of supported IP address (the first one is the copy of interface one).
I modified ipport enabling USE_IPFILTER and then implemented ipf_filter function that is used within ip_rcv() in ipdemux.c.
I modified arprcv() within et_arp.c adding multiple check where there was this line
(if (arphdr->ar_tpa != pkt->net->n_ipaddr) I modified icmprcv() within icmp.c adding multiple check where there was this line
if ((pip->ip_dest == 0xffffffff) I modified iproute() within ip.c adding multiple check where there was this line
if((ifp->snmask != 0) && /* skip ifaces with no ip or subnet mask set */
(ifp->n_ipaddr != 0) &&
((ifp->n_ipaddr & ifp->snmask) == (host & ifp->snmask))) I modified ip_rcv_phase2() within ipdemux.c adding multiple check where there was this line
if ((pip->ip_dest != nt->n_ipaddr) && /* quick check on our own addr */
(pip->ip_dest != 0xffffffffl) && /* physical cable broadcast addr*/
(pip->ip_dest != nt->n_netbr) && /* all subnet broadcast */
(pip->ip_dest != nt->n_netbr42) && /* all subnet bcast (4.2bsd) */
(pip->ip_dest != nt->n_subnetbr) &&/* our subnet broadcast */
(nt->n_ipaddr & ~nt->snmask)) /* know our own host address? */ I modified udpdemux() within udp.c adding multiple check where there was this line
if ((pip->ip_dest == 0xffffffffl) || /* physical cable broadcast addr*/
(pip->ip_dest == p->net->n_netbr) || /* all subnet broadcast */
(pip->ip_dest == p->net->n_netbr42) || /* all subnet bcast (4.2bsd) */
(pip->ip_dest == p->net->n_subnetbr)) /* our subnet broadcast */ That's all I've modified! Up to now it seems to work and I didn't need to modify anything else.
About multiple MAC address I can't answer you anything because I didn't have the necessity to support that feature...
Let me know if my suggestion was useful and eventually if you find some other point where my kind of modifications are required.
Good luck!
Paolo