rib: Updated logic for inserting and comparing rib entries.

refs #1473

Change-Id: Ie4b34d0e4a72191a96f93f8833e7119c007804a7